library _;

import 'dart:ui';

import 'package:desktop_multi_window/desktop_multi_window.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_meedu_videoplayer/meedu_player.dart';
import 'package:flutter_yfree/YFree.dart';
import 'package:pc/View/Loader.dart';
import 'package:pc/View/MouseMenu.dart';
import 'package:window_manager/window_manager.dart';

part 'controller.dart';

part 'view.dart';

class ShowVideoPage extends YPage {
  ShowVideoPage({required this.video});

  String video;

  final meeduPlayerController = MeeduPlayerController();
  bool isPlaying = false;
  bool isNet = true;
  VoidCallback? listener;
  Duration? lastPosition;

  @override
  void yOnCreate() {
    windowManager.setTitleBarStyle(TitleBarStyle.hidden, windowButtonVisibility: false);
    controller_initVideo();
  }

  @override
  void yOnDestory() {
    windowManager.setTitleBarStyle(TitleBarStyle.hidden, windowButtonVisibility: true);
    controller_disposeVideo();
  }

  @override
  Widget yBuild(BuildContext context) {
    return Container(
      color: Colors.black,
      child: Stack(
        alignment: Alignment.center,
        children: [
          view_video(),
          view_close(),
        ],
      ),
    );
  }
}
